package bupt.wangyan;
/*
 * 输入数组长度 n 
输入数组      a[1...n] 
输入查找个数m 
输入查找数字b[1...m] 
 
输出 YES or NO  查找有则YES 否则NO 
 
如(括号内容为注释) 
输入： 
5(数组长度) 
1 5 2 4 3(数组) 
3(查找个数) 
2 5 6(查找具体数字) 
输出： 
YES 
YES 
NO 
 */
import java.util.Scanner;

public class Pro2010_1 {

	/**
	 * @param args
	 * void
	 */
	static boolean contain(int [] arr, int dig) {
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == dig) {
				return true;
			}
		}
		return false;
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sca = new Scanner(System.in);
		int arrlen = sca.nextInt();
		int [] arr = new int[arrlen];
		for (int i = 0; i < arrlen; i++) {
			arr[i] = sca.nextInt();
		}
		int queryNum = sca.nextInt();
		while (queryNum > 0) {
			int dig = sca.nextInt();
			if (contain(arr, dig)) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
			queryNum--;
		}
	}

}
